/*
 * All rights Reserved, Designed By DataDriver
 * Copyright:    DataDriver.Inc
 * Company:      Zhuo Wo Infomation Technology (ShangHai) CO.LTD
 */
package com.sun.aware;

import com.sun.model.User;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;

/**
 * 发布事件
 *  @EventListener进行事件的监听的
 */
@Component
public class MyListenerAware implements ApplicationEventPublisherAware {

    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        User user =  new User();
        user.setUserName("zahngsan");
        user.setId("22");
        applicationEventPublisher.publishEvent(user);
    }
}
